﻿using System;
using System.Collections.Generic;
using System.Configuration;
using System.Data;
using System.Linq;
using System.Windows;

namespace LiveWriterBackupWPF
{
    /// <summary>
    /// Interaction logic for App.xaml
    /// </summary>
    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            if (e.Args != null && e.Args.Count() > 0)
            {
                if (!WLMisc.IsAnAdministrator())
                {
                    this.Properties["Restart"] = true;
                    WLMisc.RestartElevated(e.Args[0]);
                    return;
                }
                this.Properties["FileName"] = e.Args[0];                
            }
            base.OnStartup(e);
        }
    }
}
